﻿using login1.bll;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp6
{
    
    public partial class Form1 : Form
    {
        LoginInfoBll loginInfoBll = new LoginInfoBll();
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if(textBox1.Text.Length==0&&textBox2.Text.Length==0)
            {
                MessageBox.Show("请输入用户名和密码！");
                return;
            }
            string name = textBox1.Text;
            string password = textBox2.Text;
            if(loginInfoBll.Login(name,password))
            {
                MainForm mainForm = new MainForm();
                mainForm.Tag = name;
                mainForm.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("失败");
            }
        }
    }
}
